package com.zjuee.service.auth.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.zjuee.base.model.Description;
import com.zjuee.base.valid.Auth;
import com.zjuee.base.valid.Insert;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author wu liang
 * @since 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class UserVo extends Description {

    @NotBlank(message = "name can't be empty", groups = {Insert.class, Auth.class})
//    @Pattern(regexp = "^[a-zA-Z]\\w{2,15}$", message = "invalid name , /^[a-zA-Z]\\w{2,15}$/", groups = {Insert.class})
    private String name;

    //真实姓名
    @NotBlank(message = "realName can't be empty", groups = {Insert.class, Auth.class})
    private String realName;

    @JsonInclude(JsonInclude.Include.NON_DEFAULT)
//    @NotBlank(message = "password can't be empty", groups = {Insert.class, Auth.class})
//    @Pattern(regexp = "^[a-zA-Z]\\w{7,15}$", message = "invalid password , /^[a-zA-Z]\\w{7,15}$/", groups = {Update.class})
    private String password;

    //手机号
    @NotBlank(message = "phone can't be empty", groups = {Insert.class, Auth.class})
//    @Pattern(regexp = "^((13[0-9])|(15[^4,\\D])|(18[0-9])|(14[5,7])|(17[0,1,3,5-8]))\\d{8}$", groups = {Insert.class, Update.class})
    private String phone;

    //角色Id
    @NotNull(message = "roleId can't be empty", groups = {Insert.class})
    private Long roleId;

    //角色名称
    private String roleName;

    //orgId
    @NotNull(message = "roleName can't be empty", groups = {Auth.class, Insert.class})
    private Long orgId;
}
